package com.joysuch.wwyt.api.mh.entity;


import com.joysuch.wwyt.core.support.AutoSetCommonFieldListener;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.annotations.SQLDelete;
import org.hibernate.annotations.SQLDeleteAll;
import org.hibernate.annotations.Where;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import javax.persistence.*;

import static javax.persistence.GenerationType.IDENTITY;

@Data
@Entity
@EntityListeners({ AuditingEntityListener.class, AutoSetCommonFieldListener.class })
@Table(name = "WWYT_API_MH_MONIT_POINT_CONFIG")
@SQLDelete(sql = "update WWYT_API_MH_MONIT_POINT_CONFIG set DELETE_FLAG = '1' where id= ?")
@SQLDeleteAll(sql = "update WWYT_API_MH_MONIT_POINT_CONFIG set DELETE_FLAG = '1' where id= ?")
@Where(clause = "DELETE_FLAG = '0'")
public class MonitPointConfig {

    @Id
    @GeneratedValue(strategy = IDENTITY)
    @ApiModelProperty("主键ID")
    private Long id;

    @ApiModelProperty("监测点编号")
    private String pointNo;

    @ApiModelProperty("监测点位号")
    private String pointCode;

    @ApiModelProperty("监测点数据")
    private Double pointValue;

    @ApiModelProperty("监测点类型")
    private String pointType;

    @ApiModelProperty("监测点单位")
    private String pointUnit;

    @ApiModelProperty("监测点校正系数")
    private Float correctionFactor;

    @ApiModelProperty("监测点所属公司名称")
    private String companyName;

    @ApiModelProperty("监测点所属公司编号")
    private String companyCode;

    @ApiModelProperty("数据发送方式")
    private String sendMethod;

    @ApiModelProperty("数据发送间隔(秒)")
    private String sendInterval;

    @ApiModelProperty("删除状态")
    private String deleteFlag;

    @ApiModelProperty("备注")
    private String remarks;
}
